				
                <div id="page-content">
			        <div class="col-sm-12 eq-box-sm">
			        	<div class="panel ">
						    <div class="panel-body">
						        <a id="add" class="btn btn-primary data-toolbar" href="#(ctx)/admin/oa/apply/resget/getEditPage?view=edit"></i>&nbsp;申请</a>
						        <table id="pageTable" class="demo-add-niftycheck" data-toolbar="#del,#add"
						               data-search="true"
						               data-show-refresh="true"
						               data-show-toggle="true"
						               data-show-columns="true"
						               data-sort-name="id"
						               data-page-list="[5, 10, 20]"
						               data-page-size="5"
						               data-pagination="true" data-show-pagination-switch="true" ></table>
						    </div>
						</div>
			        </div>
                </div>
<script>
	
	var col = [{field: 'id', title: '主键', align: 'center'},
		{field: 'title', title: '标题', align: 'center'},
		{field: 'get_user_name', title: '领用人', align: 'center'},
		{field: 'get_sum', title: '领用数量', align: 'center'},
		{field: 'if_submit', title: '是否提交', align: 'center',
		       formatter:function(value,row,index){
		    	   if(value=='0'){//未提交
		    		   return "未提交";
		    	   }else{
		    		   return "已提交";
		    	   }
		       }
		   },
		   {field: 'if_complete', title: '是否完成', align: 'center',
		       formatter:function(value,row,index){
		    	   if(value=='0'){//未完成
		    		   return "未完成";
		    	   }else{
		    		   return "已完成";
		    	   }
		       }
		   },
		   {field: 'get_time', title: '领用时间', align: 'center'},
		{field: 'back_time', title: '归还时间', align: 'center'},
		{field: 'if_submit', title: '操作', align: 'left', width:'240',
		       formatter:function(value,row,index){
		           //通过formatter可以自定义列显示的内容
		           //value：当前field的值，即id
		           //row：当前行的数据
		            var a = '';
		            if(value=='0'){//未提交
		            		a = '<a class="label label-table label-success" onclick="startProcess(\''+row.id+'\')" href="javascript:void(0);" >提交</a>&nbsp;';
							a = a + '<a class="label label-table label-success" href="'+ctx+'/admin/oa/apply/resget/getEditPage?id='+row.id+'&view=detail" >查看</a>&nbsp;';
			                a = a + '<a class="label label-table label-success" href="'+ctx+'/admin/oa/apply/resget/getEditPage?id='+row.id+'&view=edit" >编辑</a>&nbsp;';
						    a = a + '<a class="label label-table label-danger" onclick="del(\''+row.id+'\')" href="javascript:void(0);" >删除</a>&nbsp;';	
		            }else{
		            		a = a + '<a class="label label-table label-info" href="javascript:void(0);" onclick="pointLion.openTaskHisListPage(\''+row.proc_ins_id+'\')">流转</a>&nbsp;';
			    		   	a = a + '<a class="label label-table label-success" href="'+ctx+'/admin/oa/apply/resget/getEditPage?id='+row.id+'&view=detail" >查看</a>&nbsp;';
			    		   	if(row.if_complete=="0"){
				    		   a = a + '<a class="label label-table label-danger" href="javascript:void(0);" onclick="callBack(\''+row.id+'\')" >撤回</a>&nbsp;';
			    			}
		            }
					
		           return a;
		       } 
		   }];
	var opt = {
		    //请求方法
			   method: 'get',
			    //是否显示行间隔色
			   striped: true,
			   //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）     
			   cache: false,  
			   //data-toolbar: "#demo-delete-row",
			   //是否显示分页（*）  
			   pagination: true,   
			    //是否启用排序  
			   sortable: false,    
			    //排序方式 
			   sortOrder: "asc",    
			   //初始化加载第一页，默认第一页
			   //我设置了这一项，但是貌似没起作用，而且我这默认是0,- -
			   //pageNumber:1,   
			   //每页的记录行数（*）   
			   pageSize: 10,  
			   //可供选择的每页的行数（*）    
			   pageList: [10, 25, 50, 100],
			   //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据  
			   url: ctx+"/admin/oa/apply/resget/listData",
			   //默认值为 'limit',传给服务端的参数为：limit, offset, search, sort, order Else
			   //queryParamsType:'',   
			   ////查询参数,每次调用是会带上这个参数，可自定义                         
			   queryParams : function(params) {
			       return {
			             pageNumber: (params.offset/params.limit)+1,
			             pageSize: params.limit
			           };
			   },
			   //分页方式：client客户端分页，server服务端分页（*）
			   sidePagination: "server",
			   //是否显示搜索
			   search: false,  
			   //Enable the strict search.    
			   strictSearch: true,
			   //Indicate which field is an identity field.
			   idField : "id",
			   columns: col,
			   pagination:true,paginationShowPageGo: true
			}; 
		
	//表格
	function initTable(){
		$('#pageTable').bootstrapTable(opt);
		$('#pageTable').bootstrapTable('hideColumn', 'id');
	}
	function refreshTable(){
		$("#pageTable").bootstrapTable('refresh', opt);
		$('#pageTable').bootstrapTable('hideColumn', 'id');
	}
	
	//删除
	function del(ids){
		pointLion.confimMsg("您是否要删除所选信息 ?<br/> 点击确认进行删除 , 点击取消取消该操作",null,function(){
			//执行删除
			var data = common_ajax.ajaxFunc("/admin/oa/apply/resget/delete",{"ids":ids}, "json", null);
			//删除结果
			if(data.success){
				pointLion.alertMsg(data.message,"success",null,function(){
					location.href = ctx+'/admin/oa/apply/resget/getListPage';//跳转到列表页
				});
			}else{
				pointLion.alertMsg(data.message,"success",null,null);
			}
		});
	};
	//提交，启动流程
	function startProcess(id){
			pointLion.confimMsg("您将要提交该单据！并且启动流程<br/><span style='color:green;'>您将无法进行修改和删除！！！</span> <br/>点击确认进行提交 , 点击取消取消该操作",null,function(){
				var data = common_ajax.ajaxFunc("/admin/oa/apply/resget/startProcess",{"id":id}, "json", null);
				if(data.success){
					pointLion.alertMsg(data.message,"success",null,function(){
						location.href = ctx+'/admin/oa/apply/resget/getDraftListPage';//跳转到列表页
					});
				}else{
					pointLion.alertMsg(data.message,"danger",null,null);
				}
			});
	}
	//撤回
	function callBack(id){
		pointLion.confimMsg("您将要撤回该单据流程！<br/><span style='color:red;'>该操作将取回单据，您将可以对单据进行修改，并可将单据重新送交审批。</span> <br/>点击确认进行撤回单据 , 点击取消取消该操作",null,function(){
			//执行删除
			var data = common_ajax.ajaxFunc("/admin/oa/apply/resget/callBack",{"id":id}, "json", null);
			//删除结果
			if(data.success){
				pointLion.alertMsg(data.message,"success",null,function(){
					location.href = ctx+'/admin/oa/apply/resget/getDraftListPage';//跳转到列表页
				});
			}else{
				pointLion.alertMsg(data.message,"danger",null,null);
			}
		});
	}
	
	$(document).ready(function(){
		
		initTable();//初始化
	});
</script>